define(function(require, exports){
	var $ = require('jquery');
	var pubjs = require('pubjs');
	var util = require('util');
	var baseGrid = require('@base/grid').baseNoDate;

	var Base = baseGrid.extend({
		init: function(config){
			config = pubjs.conf(config, {
				'cols': [
					{"name":"_id", "text": LANG('ID')}
					,{"name": "name", "text": LANG('name')}
					,{"name": "title", "text": LANG('title')}
					,{"name": "BdxId","text":LANG("内部Id"),"width":210}
					,{"name": "templateId","text":LANG("templateId(模板Id)"),"width":210}
					,{"type": "op", "render": 'renderOp'}
				]
				,"opClick": true
				,'hasSearch': false
				,'hasTab': false
				,'hasExport': false
				,'hasAmount': false
				,'hasRefresh': true
				,'url': 'ptc/list'
				,'sub_field': '_id'
				,'reqType': 'websocket'
				,'pager': {'size':10}
				,'param' :{
					'Type': 2,
					'noAmount': true
				}
			});

			this.Super('init', arguments);
		}
		,renderOp: function(a, b, data) {
			var op = [
				'<a data-op="edit" title="'+LANG("编辑记录")+'">'+LANG("编辑记录")+'</a>'
				,'<a data-op="del" title="'+LANG("删除记录")+'">'+LANG("删除记录")+'</a>'
			];

			if(data.IsDeleted) {
				op.push('<a data-op="recover" title="'+LANG("恢复")+'">'+LANG("恢复")+'</a>');
			}
			else {
				op.push('<a data-op="hide" title="'+LANG("隐藏模板")+'">'+LANG("隐藏模板")+'</a>');
			}

			return op.join('|')
		}
	});

	exports.base = Base;

});